package com.iqiyi.pps.epg.core.model.sginal;

import com.iqiyi.pps.epg.api.model.web.sginal.TSginalStatus;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by zhang on 2017/7/24.
 */
@Entity
@Table(name = "sginal_status")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONE)
public class SginalStatus {
    private Long id;
    private Integer fatherId;
    private String serverIp;
    private String statusArgs;
    private Timestamp addTime = new Timestamp(System.currentTimeMillis());

    public TSginalStatus convertThriftModel() {
        TSginalStatus tSginalStatus = new TSginalStatus();
        tSginalStatus.setId(this.id);
        tSginalStatus.setFatherId(this.fatherId);
        tSginalStatus.setServerIp(this.serverIp);
        tSginalStatus.setStatusArgs(this.statusArgs);
        tSginalStatus.setAddTime(this.addTime.toString());
        return tSginalStatus;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="father_id")
    public Integer getFatherId() {
        return fatherId;
    }

    public void setFatherId(Integer fatherId) {
        this.fatherId = fatherId;
    }

    @Column(name="server_ip")
    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    @Column(name="status_args")
    public String getStatusArgs() {
        return statusArgs;
    }

    public void setStatusArgs(String statusArgs) {
        this.statusArgs = statusArgs;
    }

    @Column(name="add_time")
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }
}
